#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#define SIZE 10
void rearrangement(int* arr)
{
	int* odd = arr;
	int* even = arr + SIZE - 1;
	int count = 0;
	while (odd<even)
	{
		while (*odd % 2 == 1)
		{
			odd++;
		}
		while (*even % 2 == 0)
		{
			even--;
		}
		if (odd < even)
		{
			int temp = *odd;
			*odd = *even;
			*even = temp;
		}
	}
}
int main()
{
	int arr[SIZE] = { 0 };
	for (int i = 0; i < SIZE; i++)
	{
		scanf("%d", &arr[i]);
	}
	rearrangement(arr);
	for (int i = 0; i < SIZE; i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}